<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>


<%@ include file="head.jsp"%>

<link rel="stylesheet" href="${baseurl}/resources/public/zTree_v3/css/metroStyle/metroStyle.css">
<script src="${baseurl}/resources/public/zTree_v3/js/jquery.ztree.all.min.js"></script>

<script src="${baseurl}/resources/admin/js/role_list.js"></script>

<div class="row">
	<ol class="breadcrumb">
		<li><a href="${baseurl }/admin">首页</a></li>
		<li class="active">角色列表</li>
	</ol>
</div>


<div class="row">
	<table class="table">
		<caption>Optional table caption.</caption>
		<thead>
			<tr>
				<th>ID</th>
				<th>角色名称</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${list}" var="role">
				<tr>
					<th scope="row">${role.rid }</th>
					<td>${role.name }</td>
					<td>

						<button class="btn btn-info accessConfig" data-toggle="modal" data-url="${baseurl }/admin/role/getrp/${role.rid }" data-rid="${role.rid }"
							data-target="#myModal">
							<span data-rid="${role.rid }" class="glyphicon glyphicon-check"></span>
						</button>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title" id="myModalLabel">权限配置</h4>
			</div>
			<div class="modal-body">
				<!-- 分类树内容 -->
					<div>
						<ul id="tree" class="ztree"></ul>
					</div>
			
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button data-url="${baseurl }/admin/role/updatepermissions" id="submitPermission" type="button" class="btn btn-primary">保存</button>
			</div>
		</div>
	</div>
</div>

<%@ include file="footer.jsp"%>

